home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6879 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  792 b 

  1. Path: tech.cftnet.com!not-for-mail
  2. From: wcowley@cftnet.com (Wes Cowley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q: 1 bit data type?
  5. Date: 20 Feb 1996 10:31:09 GMT
  6. Organization: CFTnet
  7. Message-ID: <4gc7te$s7s@tech.cftnet.com>
  8. References: <4g69if$edt@golden.ncw.net>
  9. NNTP-Posting-Host: ppp244_4.cftnet.com
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Kit Arbuckle (arbuckle@ncw.net) wrote:
  13. :     Does anyone know how to set up a data type that contains only one 
  14. : bit in BC452? I am currently using chars, but that is an awful waste of 
  15. : space to store a boolean value. I know I could use masking or shifting of 
  16. : bits, but this would be simpler. Thanks in advance...
  17.  
  18. Look up bit fields in your favorite C++ book:
  19.  
  20.    struct
  21.    {
  22.       int flag1 : 1
  23.       int flag2 : 1
  24.       // ...
  25.    }
  26.  
  27. Wes
  28.